################
#PSRM: Explaining Support for Redistribution: Social Insurance Systems and Fairness
#
#Observational Data: ESS
#Analysis
#
#Verena Fetscher
#July 2022
####################

rm(list=ls())

#setwd("your/master/file/location")

sink("analysis_ESS_logr.log")


########################
#Load Packages
####################

library("foreign")
library("MASS")

#multiple imputation
library(Amelia)
library(Zelig)


library(tidyverse)
library(texreg)
library(xtable)
library(DeclareDesign)
library(ggeffects)

#Set seed
set.seed(123)

# Main
source("figure_1.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure 1
source("figure_2.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure 2
source("figure_3.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure 3

# Appendix
source("figure_a1.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure A.1
source("figure_a2.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure A.2
source("figure_b3.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B.3
source("figure_b4.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B.4
source("figure_b5.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B.5
source("figure_b6.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B.6
source("figure_b7.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B.7
source("figure_b8.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B.8
source("figure_b9.R", echo=TRUE, max.deparse.length=Inf) #Produces Figure B.9
source("table_b2.R", echo=TRUE, max.deparse.length=Inf) #Produces Table B.2
source("table_b3.R", echo=TRUE, max.deparse.length=Inf) #Produces Table B.3
source("table_c4.R", echo=TRUE, max.deparse.length=Inf) #Produces Table C.4
source("table_c5.R", echo=TRUE, max.deparse.length=Inf) #Produces Table C.5

sink()
